<!-- Designed and Developed by VSE Group -->
<!-- For any concerns :  gaurav.pruthi@tcs.com -->

<?php
session_start(); 
require './classes/statusOfCr.php';
require './classes/php-excel.class.php';
//$log = new KLogger ( "log.txt" , KLogger::DEBUG ); 
?>					



<?php
$username = $_SESSION['username'];
if($username==null || $username== ""|| $username == "")
{
header('Location: http://172.26.195.159/checklist/php/logout.php');
}

//Connecting to database...
$con = mysql_connect("localhost","root","");
mysql_select_db("checklist" , $con);
?>


<?php
$s = "select id,designer,pl,start_date,end_date,status from cr_status";
$result = mysql_query($s);
// create a simple 2-dimensional array
$data_xls = array(
			1 => array('ID' , 'Designer' , 'Start Date' , 'End Date' , 'Status' , 'PL')
            );
while($row = mysql_fetch_array($result)) 
{		
$i  = $row['status'];
$data_xls[] = array($row['id'] , $row['designer'] , $row['start_date'] , $row['end_date'] , getStatus($i) , $row['pl']);
}

$today = date("d-m-y");
// generate file (constructor parameters are optional)
$xls = new Excel_XML('UTF-8', false, 'Report'.$today);
$xls->addArray($data_xls);
$xls->generateXML('Report'.$today);
?>